<template>
    <div>
        <template v-for="item in catalogs">
            <el-menu-item v-if="!item.children || !item.children.length" :key="item.id" :index="item.url">
                <i :class="item.icon"></i>
                <span slot="title">{{item.name}}</span>
            </el-menu-item>
            <el-submenu v-else :key="item.id" :index="item.url">
                <template slot="title">
                    <i :class="item.icon"></i>
                    <span>{{item.name}}</span>
                </template>
                <navmenu :catalogs="item.children"></navmenu>
            </el-submenu>
        </template>
    </div>
</template>

<script>
export default {
  name: "navmenu",
  props: ["catalogs"],
  data() {
    return {};
  },
  methods: {}
};
</script>

<style scoped> 
</style>

